package com.yunshu.yunshuapp.xianhuo;

import android.content.Intent;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;

import com.yunshu.yunshuapp.NavigationBar;
import com.yunshu.yunshuapp.R;

public class SelectionListActivity extends AppCompatActivity implements View.OnClickListener {

    public static final int REQUEST_CODE = 10000;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_selection_list);

        NavigationBar bar = (NavigationBar) findViewById(R.id.navigationBar);
        bar.setTitle("发布中心");
        bar.putInActivity(this);

        View btn1 = findViewById(R.id.selection1);
        View btn2 = findViewById(R.id.selection2);
        btn1.setOnClickListener(this);
        btn2.setOnClickListener(this);
    }

    @Override
    public void onClick(View view) {
        Intent mIntent = new Intent();

        if (view.getId() == R.id.selection1){
            mIntent.putExtra("data", "现货");

            this.setResult(RESULT_OK,mIntent);
        }else if(view.getId() == R.id.selection2){
            mIntent.putExtra("data", "采购");
            this.setResult(RESULT_OK,mIntent);
        }
        this.finish();
    }
}
